// 角色接口管理
import request from "@/utils/request";

const API = {
  ROLE_PAGE: "role/page",
  ROLE_LIST: "role/list",
  ROLE_CREATE_OR_EDIT: "role/createOrEdit",
  ROLE_GET_BY_ID: "role/getById",
  ROLE_REMOVE: "role/remove",
  ROLE_ALLOC_MENU: "role/allocMenu",
  ROLE_LOAD_MENU: "role/loadMenu",
}

export const roleList = () => request.get(API.ROLE_LIST);

export const rolePage = (data) => request.post(API.ROLE_PAGE, data);

export const roleCreateOrEdit = (data) => request.post(API.ROLE_CREATE_OR_EDIT, data);

export const roleGetById = (id) => request.get(API.ROLE_GET_BY_ID + `/${id}`);

export const roleRemove = (id) => request.delete(API.ROLE_REMOVE + `/${id}`);

export const roleAllocMenu = (data) => request.post(API.ROLE_ALLOC_MENU, data);

export const roleLoadMenu = (id) => request.get(API.ROLE_LOAD_MENU + `/${id}`);
